﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TriganleTests.Question;
using CodeTestFramework;
namespace TriganleTests.Tests
{    
    public partial class BasicTests : UnitTestBase<ITriangle>
    {
        [TestMethod]
        public void TestonTriangleScenario()
        {

            Assert.AreEqual<int>(1, Instance.InTriangle(new MyPoint(0.0, 5.0), new MyPoint(5.0, 0.0), new MyPoint(0.0, 0.0), new MyPoint(2.5, 2.5)),
                "Select point is on the Triangle edge");
        }

        [TestMethod]
        public void TestMinOutTriangleScenario()
        {

            Assert.AreEqual<int>(0, Instance.InTriangle(new MyPoint(0.0, 5.0), new MyPoint(5.0, 0.0), new MyPoint(0.0, 0.0), new MyPoint(2.500001, 2.5)),
                "Select point is on the Triangle edge");
        }
        
        [TestMethod]
        public void TestMiddleValueScenario()
        {

            Assert.AreEqual<int>(1, Instance.InTriangle(new MyPoint(-3.5, 5.0), new MyPoint(100, 0.0), new MyPoint(100.0, 900.0), new MyPoint(100, 500)),
                "Select point is out of the Triangle edge");
        }

        [TestMethod]
        public void TestSamePointForTriValueScenario()
        {

            Assert.AreEqual<int>(-1, Instance.InTriangle(new MyPoint(5.0, 5.0), new MyPoint(5, 5), new MyPoint(5.0f, 5f), new MyPoint(100, 500)),
                "Select point is out of the Triangle edge");
        }

        [TestMethod]
        public void TestOnVertexScenario()
        {

            Assert.AreEqual<int>(1, Instance.InTriangle(new MyPoint(50, 0), new MyPoint(500, 500), new MyPoint(0, 50), new MyPoint(500, 500)),
                "Select point is out of the Triangle edge");
        }

        [TestMethod]
        public void TestMinValueScenario()
        {
            Assert.AreEqual<int>(0, Instance.InTriangle(new MyPoint(double.MinValue, 0), new MyPoint(double.MinValue, 500), new MyPoint(0, 50), new MyPoint(double.MinValue, 500)),
                "Select point is out of the Triangle edge");
        }



    }
}
